Multi-threaded programs are difficult to understand and debug since the programmers have to deal with multiple flows of control. One common form of bug in a shared-memory, multi-threaded program is the data race. Data races in multi-threaded programs result from unsynchronized access to shared data and are good indications of computer program errors or bugs. Traditional methods to detect and debug the programs include both static and dynamic techniques. However, these traditional methods have several limitations.
Static techniques typically analyze the source code while the program is not running. While static techniques are accurate since they find all the potential data races in a program, static techniques have some critical limitations. Static techniques are not scalable to large code bases and they tend to make conservative assumptions that lead to the reporting of a large number of false data races. That is, static techniques often report a large number of data races that, in actuality, present no problems to the execution of the program. Consequently, static techniques are not frequently used since they place a tremendous burden on the developer to track down the true data races, as well as on the computational resources since many false data races are found in addition to the true data races.
Dynamic techniques, on the other hand, search for data races while the program is running. Unlike static techniques, dynamic techniques are scalable to applications with large code bases and are more precise than static tools since they analyze an actual execution of a program. However, traditional dynamic techniques also have several limitations.
The primary limitation is its run-time overhead, as dynamic tools analyze every memory operation executed by a multi-threaded program. Thus, using dynamic tools requires a significant number of computing resources since the program is running and constantly executing code and accessing memory. This increases cost, complexity and time. These dynamic data race detectors for managed code have been able to utilize some built-in synergies since the cost of maintaining meta-data for the objects in a runtime system are utilized in a managed code environment. However, for unmanaged code such as C and C++, the runtime performance and associated costs continues to remain very high.
Another limitation of dynamic data-race detectors is the lower coverage of data races due to the fact that a dynamic analysis only examines the dynamic path of one execution of the program, which provides less than 100% coverage. In order to get 100% coverage, multiple tests must be conducted which in turn requires more resources.
Consequently, a need exists for a data race detector which detects a satisfactory number of true data races while significantly reducing the amount of resources required in terms of equipment, personnel and time.